Fix dataset downloads: use the figshare API endpoint (WAF blocks ndownloader)#337
Open
JPL11 wants to merge 1 commit into
Open
Fix dataset downloads: use the figshare API endpoint (WAF blocks ndownloader)#337JPL11 wants to merge 1 commit into
JPL11 wants to merge 1 commit into
Conversation
figshare.com/ndownloader now sits behind an AWS WAF bot challenge that returns an empty HTTP 202 to non-browser clients, so urllib-based downloads produce a 0-byte file and extraction fails (neuromorphs#329, neuromorphs#330). The api.figshare.com/v2/file/download endpoint serves the same files (same ids) without the challenge; the DVSGesture test archive downloads completely from it and matches the expected md5.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #337 +/- ##
===========================================
- Coverage 76.48% 74.98% -1.51%
===========================================
Files 48 49 +1
Lines 2994 3054 +60
===========================================
Hits 2290 2290
- Misses 704 764 +60 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #329, fixes #330.
What broke
figshare.com/ndownloader/files/<id>now sits behind an AWS WAF bot challenge. Non-browser clients get an emptyHTTP 202withx-amzn-waf-action: challengeinstead of the file, so tonic's downloader writes a 0-byte archive (0it [00:00, ?it/s]in the reports) and extraction fails. A browser user agent does not help; the challenge is not UA-based.The fix
https://api.figshare.com/v2/file/download/<id>serves the same files (same ids) without the challenge, redirecting straight to S3. This PR swaps the three affected URLs (DVSGesture train/test, CIFAR10DVS); the md5s are unchanged.Verification
curl -sI https://figshare.com/ndownloader/files/38022171→202,x-amzn-waf-action: challenge, 0 bytes56070e45dadaa85fff82e0fbfbc06de5